<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<META name="keywords" content="$!config.keywords" />
<META name="description" content="$!config.description" />
<title>$!dir.title - 发表话题</title>
<link rel="stylesheet" href="skin/gold/css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="skin/gold/css/style.css" type="text/css" media="screen" />
<script type="text/javascript" src="res/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="res/js/common.js"></script>
<script type="text/javascript" src="skin/gold/js/html5.js"></script>
<script type="text/javascript" src="skin/gold/js/ikeke.js"></script>
<!--[if lte IE 6]>
<script type="text/javascript" src="skin/gold/js/DD_belatedPNG.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('a,a:hover,div,span,img,li');
</script>
<![endif]-->
<script>
#if(!$need_verify)
var need_verify=1;
var yzm_str='<INPUT name=randomCode size=6 maxlength=4><span style="padding-left:0px;"><img src="/bbs/randomCode.do" align="middle"></span>请输入前面图中的四位验证码，字母不区分大小写';
#else
var need_verify=0;
#end
function checkFocus(){
if(need_verify==1){
    if(document.getElementById('randomCodeImg').innerHTML==null || document.getElementById('randomCodeImg').innerHTML==''){
      document.getElementById('randomCodeImg').innerHTML=yzm_str;
    }
  }  
 }
var score_str='积分:<INPUT name=vrvalue size=6 maxlength=4 value=$!vrvalue>';
function showScore(v){ 
if(v=="score"){
    if(document.getElementById('scoreSpan').innerHTML==null || document.getElementById('scoreSpan').innerHTML==''){
      document.getElementById('scoreSpan').innerHTML=score_str;
    }
  } 
  else  document.getElementById('scoreSpan').innerHTML="";
 }
function doSave()
{
	if(doCheck())
	{
		if(EditForm.cid.value!="")EditForm.parameter.value="update";
		EditForm.submit();
	}
}

function openScript(url, width, height){
var Win =window.open(url,"openScript",'left=150,top=200,width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
}
function doCheck()
{
if(EditForm.title.value=="")
{
alert("标题不能为空！");
EditForm.title.focus();
return false;
}
if(EditForm.content.value=="")
{
alert("内容不能为空！");
EditForm.content.focus();
return false;
}
return true;
}
var tagpic=#if($tagpic)$!tagpic #else 0 #end;
function init()
{
	if(tagpic>0)
	EditForm.tagpic[tagpic-1].checked=true;
}
function doRefresh(obj,file)
{
	if(file!="")
	{
		eval(obj+".value=file");
	}
	EditForm.vrtype.value="$!vrtype";
}

function doUploadImg()
{
	upImgFrame.EditForm.parentObj.value="EditForm.imgs";
	upImgFrame.EditForm.types.value="doc";
	upImgFrame.doUpload();
}

function doUpload()
{
	upFrame.EditForm.parentObj.value="EditForm.files";
	upFrame.EditForm.types.value="doc";
	upFrame.doUpload();
}
</script>
</head>
<body>
<div id="container">
	<div id="asideback"></div>
	<div id="asideswitch"><div class="button"></div></div>
	#parse('/inc/left.htm')
	
	<div id="rightbody"><!-- 主体部分 -->
		<section id="wrapper">
			#parse('/inc/head.htm')
			#parse('/inc/dir_info.htm')
			#parse('/inc/doc_search.htm')
			
			<table class="post2">
				<thead>
					<tr><th colspan="2">发表新话题</th></tr>
				</thead>
				<tbody>
					<tr>
						<th width="168">
							<div class="user">
								<p class="avatar">
									<a href="/bbs/bbsuser.do?parameter=show&user=$!user.username">
									#if($user.photo)
									<img src="$!user.photo" align="absmiddle" onload="javascript:if(this.width>120)this.width=120" />
									#else
			                       	<img src="skin/gold/images/headlogo/default.jpg" align="absmiddle" onload="javascript:if(this.width>120)this.width=120" />
									#end
									<br />$!user.username</a><br /><span class="red">注册用户</a>
								</p>
								<p class="info">
									<a href="/bbs/bbsfriends.do?parameter=add&friend=$!user.username" class="left"><img src="skin/gold/images/post/join_before.jpg" alt="" />加为好友</a>
									<a href="/bbs/bbsmessage.do?parameter=write&toname=$!user.username" class="right"><img src="skin/gold/images/post/message_before.jpg" alt="" />发短信息</a>
									<div class="clear"></div>
								</p>
							</div>
						</th>
						<td>
						<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="border-top:1px solid #dec49f;">
				<form name="EditForm" method="post" action="/bbs/bbsdoc.do">
					<input type="hidden" name="parameter" value="add" />
					<input type="hidden" name="cid"   value="$!cid" />
					<input type="hidden" name="dirsn"   value="$!dir.sn" />
					<tr>
						<th>标题：</th>
						<td>
						<input name="title" type="text" class="input3" id="title" value="$!title" size="40" onFocus="checkFocus();">
						<span>标题不超过20字</span></td>
					</tr>
					<tr>
						<th>类型：</th>
						<td><select name="vrtype" onChange="showScore(this.value);" onFocus="checkFocus();">
						<option value="">公开</option>
						<option value="user"#if($vrtype=="user") selected#end>会员可见</option>
						<option value="score"#if($vrtype=="score") selected#end>积分限制</option>
						<option value="reply"#if($vrtype=="reply") selected#end>回复可见</option>
						</select>
						<span id="scoreSpan"></span></td>
					</tr>
					<tr>
						<th>表情图片<br /><span><a href="javascript:openScript('/bbs/smiley.htm?start=1',500,400)">加入心情图标<img src="skin/gold/images/post/add_button.jpg" alt="" /></a></span></th>
						<td>
							<label><input type="radio" name="tagpic" value="1" #if($tagpic=="1") checked#end /><img src="/bbs/images/emot/face1.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="2" #if($tagpic=="2") checked#end /><img src="/bbs/images/emot/face2.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="3" #if($tagpic=="3") checked#end /><img src="/bbs/images/emot/face3.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="4" #if($tagpic=="4") checked#end /><img src="/bbs/images/emot/face4.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="5" #if($tagpic=="5") checked#end /><img src="/bbs/images/emot/face5.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="6" #if($tagpic=="6") checked#end /><img src="/bbs/images/emot/face6.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="7" #if($tagpic=="7") checked#end /><img src="/bbs/images/emot/face7.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="8" #if($tagpic=="8") checked#end /><img src="/bbs/images/emot/face8.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="9" #if($tagpic=="9") checked#end /><img src="/bbs/images/emot/face9.gif" alt="" /></label><br />
							<label><input type="radio" name="tagpic" value="10" #if($tagpic=="10") checked#end /><img src="/bbs/images/emot/face10.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="11" #if($tagpic=="11") checked#end /><img src="/bbs/images/emot/face11.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="12" #if($tagpic=="12") checked#end /><img src="/bbs/images/emot/face12.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="13" #if($tagpic=="13") checked#end /><img src="/bbs/images/emot/face13.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="14" #if($tagpic=="14") checked#end /><img src="/bbs/images/emot/face14.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="15" #if($tagpic=="15") checked#end /><img src="/bbs/images/emot/face15.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="16" #if($tagpic=="16") checked#end /><img src="/bbs/images/emot/face16.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="17" #if($tagpic=="17") checked#end /><img src="/bbs/images/emot/face17.gif" alt="" /></label>
							<label><input type="radio" name="tagpic" value="18" #if($tagpic=="18") checked#end /><img src="/bbs/images/emot/face18.gif" alt="" /></label>
						</td>
					</tr>
					<tr>
						<th>内容</th>
						<td>
							#if($user)
							<textarea cols="60" rows="5" name="content" onFocus="checkFocus();">$!content</textarea>
							#else
							您还没有
							[<a class=cblue href="/bbs/bbsuser.do?parameter=reg"> 注册</a>] 或
							[<a class=cblue href="/bbs/bbsuser.do">登录</a>]
							#end
						</td>
					</tr>
					<tr class="narrow">
						<td class="alignright">相关图片：</td>
						<td><input id="imgs" type="text" name="imgs" class="normal" value="$!imgs" /><span>各图片之间用逗号隔开</span>#if($canUpload)<iframe name="upImgFrame" style="vertical-align:middle" id="upImgFrame" src="/bbs/bbsUpload.do" frameborder=0 scrolling=no width="180" height="25"></iframe><input type="button" name="Submit2" value="" class="us" onClick="doUploadImg();" />#end</td>
					</tr>
					<tr class="narrow">
						<td class="alignright">相关附件：</td>
						<td><input id="files" type="text" name="files" class="normal" value="$!files" /><span>各附件之间用逗号隔开</span>#if($canUpload)<iframe name="upFrame" style="vertical-align:middle" id="upFrame" src="/bbs/bbsUpload.do" frameborder=0 scrolling=no width="180" height="25"></iframe><input type="button" name="Submit3" value="" class="us" onClick="doUpload();" />#end</td>
					</tr>
					#if(!$need_verify)
					<tr class="narrow">
						<td class="alignright">验证码：</td>
						<td><div id=randomCodeImg></div>请输入前面图中的四位验证码，字母不区分大小写</td>
					</tr>
					#end
					<tr><td></td><td><img type="image" name="submit1" src="skin/gold/images/public/post_topics_button.jpg"  onClick="doSave();" style="cursor:pointer" /></td></tr>
				</form>
				</table>
				</td>
				</tr>
				</tbody>
			</table>
		</section>
	</div>
	
	#parse('/inc/foot.htm')
</div>
</body>
</html>